package net.monkeybros.sbus.model;

import com.neurospeech.wsclient.*;
import org.w3c.dom.*;

public class InfoTipoNodo extends WSObject
{
	
	private Integer _tipo;
	public Integer gettipo(){
		return _tipo;
	}
	public void settipo(Integer value){
		_tipo = value;
	}
	private String _descripcion;
	public String getdescripcion(){
		return _descripcion;
	}
	public void setdescripcion(String value){
		_descripcion = value;
	}
	private String _icon;
	public String geticon(){
		return _icon;
	}
	public void seticon(String value){
		_icon = value;
	}
	private Integer _levelzoom;
	public Integer getlevelzoom(){
		return _levelzoom;
	}
	public void setlevelzoom(Integer value){
		_levelzoom = value;
	}
	
	public static InfoTipoNodo loadFrom(Element root) throws Exception
	{
		if(root==null){
			return null;
		}
		InfoTipoNodo result = new InfoTipoNodo();
		result.load(root);
		return result;
	}
	
	
	protected void load(Element root) throws Exception
	{
		this.settipo(WSHelper.getInteger(root,"tipo",false));
		this.setdescripcion(WSHelper.getString(root,"descripcion",false));
		this.seticon(WSHelper.getString(root,"icon",false));
		this.setlevelzoom(WSHelper.getInteger(root,"levelzoom",false));
	}
	
	
	
	public Element toXMLElement(Element root)
	{
		Element e = root.getOwnerDocument().createElement("InfoTipoNodo");
		fillXML(e);
		return e;
	}
	
	public void fillXML(Element e)
	{
		WSHelper.addChild(e,"tipo",String.valueOf(_tipo),false);
		if(_descripcion!=null)
			WSHelper.addChild(e,"descripcion",String.valueOf(_descripcion),false);
		if(_icon!=null)
			WSHelper.addChild(e,"icon",String.valueOf(_icon),false);
		WSHelper.addChild(e,"levelzoom",String.valueOf(_levelzoom),false);
	}
	
}
